<?php
/**
 *
 * @author james
 * @version 
 */
require_once 'Zend/View/Interface.php';

/**
 * InboxMessageView helper
 *
 * @uses viewHelper Zend_View_Helper
 */
class Zend_View_Helper_InboxMessageView extends Zend_View_Helper_Abstract {
	
	/**
	 * @var Zend_View_Interface 
	 */
	public $view;
	
	/**
	 *  
	 */
	public function inboxMessageView($messages) {
		$html = "";
		foreach ($messages as $rootMessage) {
			$html.="Sender: ".$rootMessage->sendUser->email."<br>";
			$html.="Subject: ".empty($message->subject) ? "(No Subject)" : $rootMessage->subject."<br>";
			$html.="Message: ".$rootMessage->message."<br>";
			$html.="Time: ".$message->created."<br>";
			$html.="<a href=\"".$this->url(array('controller'=>'message', "action"=>"replymessage", "mid"=>$message->messageId), "default", true)."\">Reply</a>";
			$html.="<hr>";
		}
		return $html;
	}
	
	/**
	 * Sets the view field 
	 * @param $view Zend_View_Interface
	 */
	public function setView(Zend_View_Interface $view) {
		$this->view = $view;
	}
}

